home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / Newton Sample Code 1.1 / **NewtonScript / Inspector Gadget-2 / Inspect.text < prev    next >
Encoding:
Text File  |  1994-02-28  |  2.2 KB  |  100 lines  |  [TEXT/MPS ]

  1. // Copyright ©1993-94 Apple Computer, Inc. All rights reserved.
  2.  
  3. constant kAppSymbol := '|Inspector:PIEDTS|;
  4.  
  5. // ---- End Project Data ----
  6.  
  7.  
  8. // ---- File Inspect.t ----
  9. Gadget :=
  10.    {title: "Application",
  11.     viewBounds: {top: 0, left: 0, right: 240, bottom: 336},
  12.     viewJustify: 16,
  13.     viewSetupFormScript:
  14.       func()
  15.       begin
  16.           local a := GetAppParams();
  17.           self.viewBounds := RelBounds(a.appAreaLeft, a.appAreaTop, a.appAreaWidth, a.appAreaHeight);
  18.       end,
  19.     _proto: protoApp,
  20.     debug: "Gadget"
  21.    };
  22.  
  23. _view000 := /* child of Gadget */
  24.    {text: "Expression:",
  25.     viewBounds: {left: 2, top: 18, right: 122, bottom: 34},
  26.     _proto: protoStaticText
  27.    };
  28.  
  29.  
  30.  
  31. expression := /* child of Gadget */
  32.    {viewBounds: {left: 2, top: 34, right: -2, bottom: 112},
  33.     text: "self.text",
  34.     viewJustify: 48,
  35.     viewFlags: 158209,
  36.     _proto: protoInputLine,
  37.     debug: "expression"
  38.    };
  39. // View expression is declared to Gadget
  40.  
  41.  
  42.  
  43. context := /* child of Gadget */
  44.    {text: "context",
  45.     viewBounds: {left: 10, top: 122, right: 154, bottom: 138},
  46.     viewFormat: 337,
  47.     viewFont: simpleFont9,
  48.     viewJustify: 8388614,
  49.     _proto: protoStaticText,
  50.     debug: "context"
  51.    };
  52. // View context is declared to Gadget
  53.  
  54.  
  55.  
  56. _view001 := /* child of Gadget */
  57.    {text: "Eval!",
  58.     viewBounds: {left: 180, top: 124, right: 224, bottom: 144},
  59.     buttonClickScript:
  60.       func()
  61.       begin
  62.           // Compile the the string expression and store the
  63.           // code block. Later show  the result.
  64.           context.inspectorGadget := compile(expression.text);
  65.           SetValue(result, 'text, context:inspectorGadget());
  66.       end,
  67.     _proto: protoTextButton
  68.    };
  69.  
  70.  
  71.  
  72. _view002 := /* child of Gadget */
  73.    {text: "Result:",
  74.     viewBounds: {left: 2, top: 146, right: 122, bottom: 162},
  75.     _proto: protoStaticText
  76.    };
  77.  
  78.  
  79.  
  80. result := /* child of Gadget */
  81.    {viewFlags: 1,
  82.     viewFormat: 337,
  83.     viewlinespacing: 20,
  84.     viewFont: ROM_fontSystem9Bold,
  85.     viewBounds: {top: 163, left: 2, right: -2, bottom: -25},
  86.     viewJustify: 240,
  87.     viewclass: 81,
  88.     debug: "result"
  89.    };
  90. // View result is declared to Gadget
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98. // ---- Beginning of section for non used Layout files ----
  99.  
  100. // End of output